package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.MeetingRoomMonitorPageQueryDTO;
import com.sky.entity.MeetingRoom;
import com.sky.entity.Monitor;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MonitorMapper {
    // 分页查询会议室监控信息
    Page<MeetingRoom> pageQuery(MeetingRoomMonitorPageQueryDTO meetingRoomMonitorPageQueryDTO);

    // 添加会议室监控信息
    @Insert("insert into monitoring(meeting_room_id,monitor_time,status,notes) values (#{meetingRoomId},#{monitorTime},#{status},#{notes})")
    void insert(Monitor monitor);

    // 根据id回显会议室监控信息
    @Select("select * from monitoring where meeting_room_id = #{id}")
    List<Monitor> getMonitorById(Long id);
}
